package com.practice.bootdemo.service.impl;

import com.practice.bootdemo.entity.TestGen;
import com.practice.bootdemo.dao.TestGenMapper;
import com.practice.bootdemo.service.TestGenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * @author :v-zhousq04
 * @description: 测试生成类服务接口实现类
 * @create date: 2019-11-30 22:36:44
 * content from code generator
 */

@Slf4j
@Service
public class TestGenServiceImpl implements TestGenService {

    @Autowired
    TestGenMapper testGenMapper;


    /**
     * 保存测试生成类
     * @param testGen
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int save(TestGen testGen) {
        log.info("TestGenServiceImpl add , param testGen={}",testGen);
        return testGenMapper.save(testGen);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateById(TestGen testGen) {
        log.info("TestGenServiceImpl updateById , param testGen={}",testGen);
        return testGenMapper.updateById(testGen);
    }

    /**
     * 删除测试生成类
     * @param id
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteById(int id) {
        log.info("TestGenServiceImpl deleteById , param id={} ",id);
        return testGenMapper.deleteById(id);
    }

    /**
     * 根据查询测试生成类
     * @param id
     * @return
     */
    @Override
    public TestGen find(int id) {
        log.info("TestGenServiceImpl find ,id = {}",id);
        return testGenMapper.find(id);
    }


    /**
     * 查询测试生成类
     * @param testGen
     * @return
     */
    @Override
    public List<TestGen> findList(TestGen testGen) {
        log.info("TestGenServiceImpl findList , param testGen={}",testGen);
        return testGenMapper.findList(testGen);
    }


}
